package com.yz.platform.common.task;

import com.yz.platform.modules.biz.entity.ActivationCodeEntity;
import com.yz.platform.modules.biz.service.ActivationCodeService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 更新激活码状态线程
 * author:lin Date : 2017/11/18 下午9:26
 */
@Component
public class UpdateCodeStatusTask implements Runnable {

    @Autowired
    private ActivationCodeService activationCodeService;

    private ActivationCodeEntity codeEntity;

    public UpdateCodeStatusTask(){}

    public UpdateCodeStatusTask(ActivationCodeEntity codeEntity){
        this.codeEntity = codeEntity;
    }


    @Override
    public void run() {


        if (codeEntity != null){

            codeEntity.setStatus(-1);
            activationCodeService.update(codeEntity);

        }





    }



}
